package cn.xi.dao;

import cn.xi.domain.Student;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface StudentDao {
    @Select("select * from student")
    List<Student> findAll();

    @Select("select * from student where name =#{name}")
    Student findById(String name);

    @Insert("insert into student (name,age) values (#{name},#{age})")
    int save(Student student);

    @Update("update student set age=#{age} where name =#{name}")
    int update(Student student);

    @Delete("delete from student where name=#{name}")
    int delete(String name);
}
